package com.lyz.dataStructure.array;

import com.lyz.dataStructure.JianZhiOffer.TreeNode;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/14 14:22
 *@Description:
 **/
public class ListNode {
    int val ;
    ListNode next = null ;
    public ListNode(int val){
        this.val = val;
    }

}

class  Solution1{

    public static void main(String[] args) {
        ListNode listNode = new ListNode(1);
        ListNode listNode2 = listNode.next;
        ListNode listNode3 = listNode2.next;
        ListNode listNode4= listNode3.next;
        ListNode listNode5 =listNode4.next;
        ListNode listNode6 = listNode5.next;
        ListNode listNode7 = listNode6.next;
        System.out.println(listNode.val);
    }

    public ListNode ReverseListNode(ListNode head){
        ListNode  prev = null ;
        ListNode curr = head;
        while(curr!=null){
            ListNode nextNode = curr.next;
            curr.next = prev;
            curr = prev;
            prev = nextNode;
        }
       return prev;
    }
}
